/*
 * @Author: Leo.wang wanglizhigs@163.com
 * @Date: 2025-06-19 22:26:03
 * @LastEditors: Leo.wang wanglizhigs@163.com
 * @LastEditTime: 2025-07-12 13:07:49
 * @FilePath: /book-website/src/router/index copy.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import {
  createRouter,
  createWebHistory,
  createWebHashHistory,
} from 'vue-router';
import Layout from '@/layout/Layout.vue';
import { beforeHook } from "./hooks";
const { VITE_BASE_PATH } = import.meta.env;

import { session } from '@/service/storage.service';

export const routes = [
  {
    path: '',
    redirect: '/login',
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/Login/index.vue'),
  },
  {
    path: '/',
    component: Layout,
    children: [
      {
        path: '',
        redirect: '/home',
      },
      {
        path: '/home',
        name: 'home',
        inMenu: true,
        component: () => import('@/views/Home/index.vue'),
      },
      {
        path: '/clinic',
        name: 'clinic',
        inMenu: true,
        component: () => import('@/views/Clinic/index.vue'),
      },
      {
        path: '/department',
        name: 'department',
        inMenu: true,
        component: () => import('@/views/Department/index.vue'),
      },
      {
        path: '/disease',
        name: 'disease',
        inMenu: true,
        component: () => import('@/views/Disease/index.vue'),
      },
      {
        path: '/hospital',
        name: 'hospital',
        inMenu: true,
        component: () => import('@/views/Hospital/index.vue'),
      },
      {
        path: '/identity',
        name: 'identity',
        inMenu: true,
        component: () => import('@/views/Identity/index.vue'),
      },
      {
        path: '/order',
        name: 'order',
        inMenu: true,
        component: () => import('@/views/Order/index.vue'),
      },
      {
        path: '/patient',
        name: 'patient',
        inMenu: true,
        component: () => import('@/views/Patient/index.vue'),
      },
      {
        path: '/service',
        name: 'service',
        inMenu: true,
        component: () => import('@/views/Service/index.vue'),
      },
      {
        path: '/user',
        name: 'user',
        inMenu: true,
        component: () => import('@/views/User/index.vue'),
      },
      {
        path: '/manage',
        name: 'manage',
        inMenu: true,
        component: () => import('@/views/Manage/index.vue'),
      },
      {
        path: '/hospitalLevel',
        name: 'hospitalLevel',
        inMenu: true,
        component: () => import('@/views/HospitalLevel/index.vue'),
      },
      {
        path: '/orderStatus',
        name: 'orderStatus',
        inMenu: true,
        component: () => import('@/views/OrderStatus/index.vue'),
      },
      {
        path: '/role',
        name: 'role',
        inMenu: true,
        component: () => import('@/views/Role/index.vue'),
      },
      {
        path: '/serverStatus',
        name: 'serverStatus',
        inMenu: true,
        component: () => import('@/views/ServerStatus/index.vue'),
      },
    ],
  },
];

const router = createRouter({
  history: createWebHistory(VITE_BASE_PATH),
  routes,
});
router.beforeEach(beforeHook)
export default router;
